using System;
using Server.Items;
using Server.Network;
using Server.Targeting;
using Server.Engines.Craft;
using Server.Mobiles;

namespace Server.Items
{
    public abstract class MineraleBase : BaseOre
    {
		[Constructable]
		public MineraleBase( CraftResource resource, int amount ) : 
            base( resource, amount )
		{
		}

        public MineraleBase(Serial serial) : base(serial)
		{
		}

        public override void AddNameProperty(ObjectPropertyList list)
        {
            list.Add(Amount.ToString() + " " + MineraleToString(this) + " grezzo");
        }

        public override void GetProperties(ObjectPropertyList list)
        {
            AddNameProperty(list);
        }
        
        public new virtual void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);
        }

        public new virtual void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
        }

        public static String MineraleToString(MineraleBase minerale)
        {
            String ret = "indefinito";

            if (minerale is MineraleFerro)
                ret = "Ferro";
            else if (minerale is MineraleRame)
                ret = "Rame";
            else if (minerale is MineraleArgento)
                ret = "Argento";
            else if (minerale is MineraleOro)
                ret = "Oro";
            else if (minerale is MineraleStagno)
                ret = "Stagno";
            else if (minerale is MineraleCarbonio)
                ret = "Carbonio";
            else if (minerale is MineraleShadow)
                ret = "Shadow";
            else if (minerale is MineraleTitanio)
                ret = "Titanio";
            else if (minerale is MineraleElectrum)
                ret = "Electrum";
            else if (minerale is MineraleOrchish)
                ret = "Orchish";
            else if (minerale is MineraleMitheril)
                ret = "Mitheril";
            else if (minerale is MineraleAgapite)
                ret = "Agapite";
            else if (minerale is MineraleHolyargon)
                ret = "Holyargon";
            else if (minerale is MineraleAdamantio)
                ret = "Adamantio";
            else if (minerale is MineraleArgon)
                ret = "Argon";
            
            return ret;
        }
    }

	public class MineraleFerro : MineraleBase
	{
		[Constructable]
		public MineraleFerro() : this( 1 )
		{
		}

		[Constructable]
		public MineraleFerro( int amount ) : base( CraftResource.Ferro, amount )
		{
		}

        public MineraleFerro(Serial serial) : base(serial)
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );

			writer.Write( (int) 0 ); // version
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
		}

		
		public override BaseIngot GetIngot()
		{
			return new LingottoFerro();
		}
	}

    public class MineraleArgento : MineraleBase
    {
        [Constructable]
        public MineraleArgento()
            : this(1)
        {
        }

        [Constructable]
        public MineraleArgento(int amount)
            : base(CraftResource.Argento, amount)
        {
        }

        public MineraleArgento(Serial serial)
            : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }


        public override BaseIngot GetIngot()
        {
            return new LingottoArgento();
        }
    }

	public class MineraleRame : MineraleBase
	{
		[Constructable]
		public MineraleRame() : this( 1 )
		{
		}

		[Constructable]
		public MineraleRame( int amount ) : base( CraftResource.Rame, amount )
		{
		}

        public MineraleRame(Serial serial) : base(serial)
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );

			writer.Write( (int) 0 ); // version
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
		}

		public override BaseIngot GetIngot()
		{
			return new LingottoRame();
		}
	}

	public class MineraleOro : MineraleBase
	{
		[Constructable]
		public MineraleOro() : this( 1 )
		{
		}

		[Constructable]
		public MineraleOro( int amount ) : base( CraftResource.Oro, amount )
		{
		}

        public MineraleOro(Serial serial) : base(serial)
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );

			writer.Write( (int) 0 ); // version
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
		}

		

		public override BaseIngot GetIngot()
		{
			return new LingottoOro();
		}
	}

	public class MineraleStagno : MineraleBase
	{
		[Constructable]
		public MineraleStagno() : this( 1 )
		{
		}

		[Constructable]
		public MineraleStagno( int amount ) : base( CraftResource.Stagno, amount )
		{
		}

        public MineraleStagno(Serial serial) : base(serial)
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );

			writer.Write( (int) 0 ); // version
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
		}

		public override BaseIngot GetIngot()
		{
            return new LingottoFerro();   
		}
	}

	public class MineraleCarbonio : MineraleBase
	{
		[Constructable]
		public MineraleCarbonio() : this( 1 )
		{
		}

		[Constructable]
		public MineraleCarbonio( int amount ) : base( CraftResource.Carbonio, amount )
		{
		}

        public MineraleCarbonio(Serial serial) : base(serial)
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );

			writer.Write( (int) 0 ); // version
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
		}

		public override BaseIngot GetIngot()
		{
            return new LingottoFerro();
		}
	}

	public class MineraleShadow : MineraleBase
	{
		[Constructable]
		public MineraleShadow() : this( 1 )
		{
		}

		[Constructable]
		public MineraleShadow( int amount ) : base( CraftResource.Shadow, amount )
		{
		}

        public MineraleShadow(Serial serial) : base(serial)
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );

			writer.Write( (int) 0 ); // version
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
		}

		public override BaseIngot GetIngot()
		{
			return new LingottoShadow();
		}
	}

	public class MineraleAgapite : MineraleBase
	{
		[Constructable]
		public MineraleAgapite() : this( 1 )
		{
		}

		[Constructable]
		public MineraleAgapite( int amount ) : base( CraftResource.Agapite, amount )
		{
		}

        public MineraleAgapite(Serial serial) : base(serial)
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );

			writer.Write( (int) 0 ); // version
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
		}

		public override BaseIngot GetIngot()
		{
			return new LingottoAgapite();
		}
	}

	public class MineraleHolyargon : MineraleBase
	{
		[Constructable]
		public MineraleHolyargon() : this( 1 )
		{
		}

		[Constructable]
		public MineraleHolyargon( int amount ) : base( CraftResource.Holyargon, amount )
		{
		}

        public MineraleHolyargon(Serial serial) : base(serial)
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );

			writer.Write( (int) 0 ); // version
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
		}

		public override BaseIngot GetIngot()
		{
			return new LingottoHolyargon();
		}
	}

	public class MineraleAdamantio : MineraleBase
	{
		[Constructable]
		public MineraleAdamantio() : this( 1 )
		{
		}

		[Constructable]
		public MineraleAdamantio( int amount ) : base( CraftResource.Adamantio, amount )
		{
		}

        public MineraleAdamantio(Serial serial) : base(serial)
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );

			writer.Write( (int) 0 ); // version
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
		}

		public override BaseIngot GetIngot()
		{
			return new LingottoAdamantio();
		}
	}

    public class MineraleArgon : MineraleBase
    {
        [Constructable]
        public MineraleArgon()
            : this(1)
        {
        }

        [Constructable]
        public MineraleArgon(int amount) : base(CraftResource.Argon, amount)
        {
        }

        public MineraleArgon(Serial serial) : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }

        public override BaseIngot GetIngot()
        {
            return new LingottoArgon();
        }
    }

    public class MineraleTitanio : MineraleBase
    {
        [Constructable]
        public MineraleTitanio()
            : this(1)
        {
        }

        [Constructable]
        public MineraleTitanio(int amount)
            : base(CraftResource.Titanio, amount)
        {
        }

        public MineraleTitanio(Serial serial)
            : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }

        public override BaseIngot GetIngot()
        {
            return new LingottoTitanio();
        }
    }

    public class MineraleElectrum : MineraleBase
    {
        [Constructable]
        public MineraleElectrum() : this(1)
        {
        }

        [Constructable]
        public MineraleElectrum(int amount) : base(CraftResource.Electrum, amount)
        {
        }

        public MineraleElectrum(Serial serial) : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }

        public override BaseIngot GetIngot()
        {
            return new LingottoElectrum();
        }
    }

    public class MineraleOrchish : MineraleBase
    {
        [Constructable]
        public MineraleOrchish()
            : this(1)
        {
        }

        [Constructable]
        public MineraleOrchish(int amount) : base(CraftResource.Orchish, amount)
        {
        }

        public MineraleOrchish(Serial serial) : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }

        public override BaseIngot GetIngot()
        {
            return new LingottoOrchish();
        }
    }

    public class MineraleMitheril : MineraleBase
    {
        [Constructable]
        public MineraleMitheril() : this(1)
        {
        }

        [Constructable]
        public MineraleMitheril(int amount) : base(CraftResource.Mitheril, amount)
        {
        }

        public MineraleMitheril(Serial serial) : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }

        public override BaseIngot GetIngot()
        {
            return new LingottoMitheril();
        }
    }
}